﻿namespace Ficharts.Net.Examples.examples.Columns
{
    using System;

    using Code;

    public partial class ColumnDemo : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                var chart = this.Test;
                chart.ChartTitle.Title = "年度销售";
                chart.Suffix.YSuffix = "万";

                chart.Series.Add(new Column { XField = "Label", YField = "Value" });
                chart.XAxises.Add(new FieldAxis { Title = "月份" });
                chart.YAxises.Add(new LinearAxis { Title = "销售额" });



                chart.DataSource = ExampleData.DemoData1();

                Test.DataBind();
            }
        }

        protected void BtnTest_Click(object sender, EventArgs e)
        {
            var chart = this.Test;
            chart.ChartTitle.Title = "年度销售";
            chart.Suffix.YSuffix = "万";

            chart.Series.Add(new Line { XField = "Label", YField = "Value" });
            chart.XAxises.Add(new FieldAxis { Title = "月份" });
            chart.YAxises.Add(new LinearAxis { Title = "销售额" });



            chart.DataSource = ExampleData.DemoData1();

            Test.DataBind();
        }
    }
}